package com.derbysoft.lowcostadapter.webservice;

import org.springframework.ws.transport.http.HttpUrlConnectionMessageSender;

import java.io.IOException;
import java.net.HttpURLConnection;

/**
 * User: 2012-10-31
 * Date: 12-10-31
 */
public class EnhanceHttpUrlConnectionMessageSender extends HttpUrlConnectionMessageSender {
    private int readTimeout;
    private int connectionTimeout;

    protected void prepareConnection(HttpURLConnection connection) throws IOException {
        connection.setReadTimeout(readTimeout);
        connection.setConnectTimeout(connectionTimeout);
        super.prepareConnection(connection);
    }

    public void setReadTimeout(int readTimeout) {
        this.readTimeout = readTimeout;
    }

    public void setConnectionTimeout(int connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

}
